<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Java实训课程 - 统计</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/getQueryString.js"></script>
<script src="libs/js.cookie-2.1.0.min.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 page-header">
				<h2>
					新加档案
					<button id="querynull" class="btn btn-primary pull-right">退出</button>
				</h2>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="col-md-8">
			<ul class="nav nav-pills">
				<li><a href="index.html">首页</a></li>
				<li><a href="add.html">新加档案</a></li>
				<li class="active"><a href="#">查询</a></li>
				<li><a href="#">用户：<span id="nickname"></span></a></li>
				<li>
					<div className="input-group">
						<input className="from-control" id="search-box-value"
							placeholder="档案号或身份证号" type="text" /> <span
							className="inputt-group-btu">
							<button id="search" className="btu btu-default"
								onClick={this.submit} type="button">
								<i className="fa fa-search">搜索</i>
							</button>
						</span>
					</div>
				</li>
			</ul>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-4">
				<div class="form-group">
					<label for="archive_id">档案号</label> <input type="text"
						class="form-control" id="archive_id" />
				</div>
				<div class="form-group">
					<label for="identity">身份证号</label> <input type="text"
						class="form-control" id="identity" />
				</div>
				<div class="form-group">
					<label for="name">姓名</label> <input type="text"
						class="form-control" id="name" />
				</div>
				<div class="form-group">
					<label for="gender">性别</label> <input type="text"
						class="form-control" id="gender" />
				</div>
				<div class="form-group">
					<label for="birthday">出生日期</label> <input type="date"
						class="form-control" id="birthday" />
				</div>
				<div class="form-group">
					<label for="date_retire1">预退休日期</label> <input type="date"
						class="form-control" id="date_retire1" />
				</div>
				<div class="form-group">
					<label for="date_retire2">实际退休日期</label> <input type="date"
						class="form-control" id="date_retire2" />
				</div>
				<div class="form-group">
					<label for="sp">特殊工种</label> <input type="text"
						class="form-control" id="sp" />
				</div>
				<div class="form-group">
					<label for="fc">女管理岗位</label> <input type="text"
						class="form-control" id="fc" />
				</div>
				<div class="form-group">
					<label for="title">职称</label> <input type="text"
						class="form-control" id="title" />
				</div>
				<div class="form-group">
					<label for="seniority">工龄</label> <input type="text"
						class="form-control" id="seniority" />
				</div>
				<button id="query" class="btn btn-primary btn-block">查询</button>
			</div>
			<div class="col-md-8">
				<div class="panel panel-primary">
					<div class="panel-heading">
						<p>查询结果</p>
					</div>
					<div class="panel-body" id="list1"></div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/x-handlebars-template" id="template">
    {{#each item}}
    <div class="panel panel-default col-md-3">
      <div class="panel-body">
        <dl>
          <dt>档案号</dt>   <dd>{{archive_id}}</dd>
          <dt>身份证浩</dt>   <dd>{{identity}}</dd>
          <dt>姓名</dt>   <dd>{{name}}</dd>
          <dt>性别</dt><dd>{{gender}}</dd>
          <dt>出生日期</dt><dd>{{birthday}}</dd>
          <dt>预退休日期</dt>   <dd>{{date_retire1}}</dd>
          <dt>实际退休日期</dt>   <dd>{{date_retire2}}</dd>
          <dt>特殊工种</dt>   <dd>{{sp}}</dd>
          <dt>女管理岗位</dt>   <dd>{{fc}}</dd>
          <dt>职称</dt>   <dd>{{title}}</dd>
          <dt>工龄</dt>   <dd>{{seniority}}</dd>
          <button id="queryall"><a href="queryall.html?id={{id}}" class="btn">显示详情</a></button>
       </dl>
     </div>
   </div>
   {{/each}}
 </script>
</body>

<script type="text/javascript">
	$(function() {
		$('#search').click(function() {
			$.post('queryone.action', {
				search : $('#search-box-value').val(),
			}, function(res, status) {
				if ("ERR1" == res) {
					alert('未查到档案')
				} else if ("ERR2" == res) {
					alert('请输入正确档案号')
				} else {
					window.location.href = 'queryone.html?id=' + res;
				}
			})
		})
	})
</script>
<script type="text/javascript">
	if (!Cookies.get("users")) {
		window.location.href = 'login.html';
	}
	$(function() {
		$('#query').click(function() {
			$.post('query.action', {
				id : $('#id').val(),
				archive_id : $('#archive_id').val(),
				identity : $('#identity').val(),
				name : $('#name').val(),
				gender : $('#gender').val(),
				birthday : $('#birthday').val(),
				date_retire1 : $('#date_retire1').val(),
				date_retire2 : $('#date_retire2').val(),
				sp : $('#sp').val(),
				fc : $('#fc').val(),
				title : $('#title').val(),
				seniority : $('#seniority').val(),
			}, function(res, status) {
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list1').html(t(data));
			})
		})
	})
</script>
<script type="text/javascript">
	$(function() {
		$.getJSON('querynick.action', function(res) {
			$('#nickname').text(res.nick);
		})
	})
</script>
<script type="text/javascript">
	$(function() {
		$.backstretch("image/4.jpg")
	})
</script>
</html>